package maping;

public class OurPoint {

    private int x, y;

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public OurPoint(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public static OurPoint getMin(OurPoint a, OurPoint b) {
        if (a.getY() < b.getY()) {
            return a;
        }
        if (a.getY() > b.getY()) {
            return b;
        }
        if (a.getX() < b.getX()) {
            return a;
        }
        if (a.getX() > b.getX()) {
            return b;
        }
        return a;
    }

    public static OurPoint getMax(OurPoint a, OurPoint b) {
        if (a.getY() < b.getY()) {
            return b;
        }
        if (a.getY() > b.getY()) {
            return a;
        }
        if (a.getX() < b.getX()) {
            return b;
        }
        if (a.getX() > b.getX()) {
            return a;
        }
        return a;
    }

    public int getX() {
        return x;
    }

    @Override
    public OurPoint clone() {
        return new OurPoint(this.x, this.y);
    }

    public int getY() {
        return y;
    }
}